package com.itqf.beanfactory;

import com.itqf.config.DataSourceConfig;
import com.itqf.pojo.DataSource;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Map;

/**
 * projectName: springframeworkgp8
 *
 * @author: 赵伟风
 * time: 2021/8/3 11:19
 * description:
 */
public class AnnotationFactory {

    public static void main(String[] args) {

        AnnotationConfigApplicationContext
                 applicationContext  = new AnnotationConfigApplicationContext(DataSourceConfig.class);


        /**
         * map key beanname value ioc类型的对象
         */
        Map<String, DataSource> beansOfType = applicationContext.getBeansOfType(DataSource.class);


        System.out.println("beansOfType = " + beansOfType);


    }
}
